#ifndef __PROGRAMMABLE_LIGHT_H__
#define __PROGRAMMABLE_LIGHT_H__

#include <cstdint>
#include <functional>
#include <list>
#include "light_group.h"

class ProgrammableLight
{
public:
    /// @brief 创建一个灯组
    /// @param pulse_frequency 方波周期
    /// @return 灯组引用
    static LightGroup &CreateGroup(uint32_t pulse_frequency)
    {
        __groups.emplace_back(pulse_frequency);
        return __groups.back();
    }

    /// @brief 删除一个灯组
    /// @param group 灯组引用
    static void DeleteGroup(LightGroup &group)
    {
        __groups.remove(group);
    }

private:
    /// @brief 灯组列表
    inline static std::list<LightGroup> __groups;
};

#endif // __PROGRAMMABLE_LIGHT_H__s